package org.example.diet_compass.resp;

import lombok.Getter;

/**
 * @author RoselleShaw
 * @create 2024-03-22 16:26
 */
@Getter
public enum ResultCodeEnum {

    // 通用状态码
    SUCCESS(200, "操作成功"),
    FAIL(240, "操作失败"),
    FILE_NULL(201, "文件不能为空"),

    // 留言模块
    MESSAGE_NOT_FOUND(202, "留言不存在"),
    MESSAGE_CONTENT_EMPTY(203, "留言内容不能为空"),
    MESSAGE_CREATE_FAILED(204, "留言创建失败"),
    MESSAGE_UPDATE_FAILED(205, "留言更新失败"),
    MESSAGE_DELETE_FAILED(206, "留言删除失败"),

    // 评论模块
    COMMENT_NOT_FOUND(207, "评论不存在"),
    COMMENT_CONTENT_EMPTY(208, "评论内容不能为空"),
    COMMENT_CREATE_FAILED(209, "评论创建失败"),
    COMMENT_UPDATE_FAILED(210, "评论更新失败"),
    COMMENT_DELETE_FAILED(211, "评论删除失败"),
    COMMENT_LIKE_FAILED(212, "评论点赞失败"),
    COMMENT_UNLIKE_FAILED(213, "取消点赞失败"),

    // 用户登录模块
    USER_NOT_FOUND(214, "用户不存在"),
    USER_PASSWORD_ERROR(215, "密码错误"),
    USER_LOGIN_FAILED(216, "登录失败"),
    USER_TOKEN_INVALID(217, "Token 无效"),
    USER_TOKEN_EXPIRED(218, "Token 已过期"),
    USER_NOT_LOGIN(219, "用户未登录"),

    // 用户信息修改模块
    USER_INFO_UPDATE_FAILED(220, "用户信息更新失败"),
    USER_AVATAR_UPLOAD_FAILED(221, "头像上传失败"),
    USER_PASSWORD_UPDATE_FAILED(222, "密码更新失败"),
    USER_EMAIL_EXIST(223, "邮箱已存在"),
    USER_PHONE_EXIST(224, "手机号已存在"),

    // 轮播图模块
    BANNER_NOT_FOUND(225, "轮播图不存在"),
    BANNER_CREATE_FAILED(226, "轮播图创建失败"),
    BANNER_UPDATE_FAILED(227, "轮播图更新失败"),
    BANNER_DELETE_FAILED(228, "轮播图删除失败"),

    // 分类图模块
    CATEGORY_NOT_FOUND(229, "分类不存在"),
    CATEGORY_CREATE_FAILED(230, "分类创建失败"),
    CATEGORY_UPDATE_FAILED(231, "分类更新失败"),
    CATEGORY_DELETE_FAILED(232, "分类删除失败"),

    // 商品模块
    PRODUCT_NOT_FOUND(233, "商品不存在"),
    PRODUCT_CREATE_FAILED(234, "商品创建失败"),
    PRODUCT_UPDATE_FAILED(235, "商品更新失败"),
    PRODUCT_DELETE_FAILED(236, "商品删除失败"),
    PRODUCT_SEARCH_FAILED(237, "商品查询失败"),
    PRODUCT_STOCK_NOT_ENOUGH(238, "商品库存不足"),
    PRODUCT_PRICE_INVALID(239, "商品价格无效"),
    //分页模块

    PAGE_NOT_RIGHT(240,"页数设置得不对/页大小设置不对"),


    //订单模块
    PRODUCT_CART_EMPTY(241, "购物车为空"),
    PRODUCT_CART_REPECT(242,"车中已存在该菜品"),
    ORDER_RECORD_NULL(243,"订单记录为空"),

    UNKNOWN(999, "未知错误");
    private final Integer code;
    private final String message;

    ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

}
